"""
求两个给定正整数的最大公约数和最小公倍数。
"""
n, m = input().split()
n, m = int(n), int(m)
max1 = 1
if m < n:
    m, n = n, m
min1 = m
for i in range(n, 0, -1):
    if n % i == 0 and m % i == 0:
        max1 = i
        break
while 1:
    if min1 % m == 0 and min1 % n == 0:
        break
    else:
        min1 += 1
print(f'{max1} {min1}')